﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Power.Model;
using System.Data;
using System.Data.SqlClient;

namespace Power.DAL
{
    public class DeviceIPDAL
    {


        public String ToFind(string sttext)
        {
            DataTable dt = SqlHelper.ExecuteDataTable("select * from T_DeviceIP where  Device= @Temppar ", new SqlParameter("@Temppar", sttext));
            
            DeviceIP  Devices=new DeviceIP();
            Devices = ToIP(dt.Rows[0]);
            string IP;
            IP = Devices.IP;

            return IP;
        }









        private DeviceIP ToIP(DataRow row)
        {
            DeviceIP op = new DeviceIP();
            op.Id = (long)row["Id"];

            op.Device = (string)row["Device"];
            op.IP = (string)row["IP"];

            return op;
        }

    }
}
